import 'package:flutter_carplay/helpers/enum_utils.dart';
import 'package:uuid/uuid.dart';

import 'now_playing_btn_type.dart';

class CPNowPlayingButton {
  final String _elementId = const Uuid().v4();

  final Function() onPress;
  //播放界面可以加入的按钮
  final CPNowPlayingButtonTypes type;
  final String? image;

  CPNowPlayingButton({
    required this.onPress,
    required this.type,
    this.image,
  });

  Map<String, dynamic> toJson() => {
        "_elementId": _elementId,
        "image": image,
        "type": CPEnumUtils.stringFromEnum(type.toString()),
      };

  String get uniqueId {
    return _elementId;
  }
}
